package main

import "fmt"
import "unsafe"

func main() {
	fmt.Println("hello, world!")
	//格式化字符串并赋值给新串
	var stockcode = 123
	var enddate = "2022-3-23"
	var url = "Code=%d&endDate=%s"
	var target_url = fmt.Sprintf(url, stockcode, enddate)
	fmt.Println(target_url)

	//声明变量
	var a string = "aaaa"
	var b, c int = 1, 2
	fmt.Println(a, b, c)

	//变量的默认值
	var i int
	var f float64
	var s string
	fmt.Printf("%v %v %v %q\n", i, f, b, s)

	var n1 = 100
	fmt.Printf("n1的类型 %T", n1)

	var n2 int64 = 10
	fmt.Printf("n2的类型 %T,字节数 %d", n2)

}
